import React from 'react'
import "./backprev.less"
import { useLocation, useNavigate } from 'react-router-dom'

const hideNavs = ['/', '/fast', '/mine']

export default function BackPrevButton() {
    const nav = useNavigate()
    const { pathname } = useLocation()
    return (
        <div style={{ display: !hideNavs.includes(pathname) ? 'block' : 'none' }} className='back' onClick={() => nav(-1)}>返回上一页</div>
    )
}
